<?php
namespace app\index\controller;


class rankController extends \app\base\controller\BaseController {

	public function index(){

        //热门点击
	$where_hot[]="1";
        $hot=obj("api/Apidata")->Data_Select("items",$where_hot,"`view` DESC LIMIT 0 , 10");
        $this->hot=$hot;
 	    //今日发布+预计
        $date=date("Y-m-d",time());
        $todaysenddata[]="  `date` LIKE  '%{$date}%' and `type` LIKE  '0' AND  `mall` LIKE  '0'";
        $this->todaysenddata=obj("api/ApiData")->Data_Count("items",$todaysenddata);
        $this->country="国内";

        //获取30分钟内热榜
        //$where_30="select * from {pre}items where date >DATE_SUB(NOW(), INTERVAL 30 MINUTE)";
        //$rettime=obj('api/ApiData')->thisquery($where_30);
		$token= new \ZhiCms\ext\weixin;
		$url="http://v2.api.haodanku.com/sales_list/apikey/wwwlegcom/sale_type/1";
		$rettime=obj("api/Api")->object_array(json_decode($token->http($url)));
        $this->rettime=$rettime['data'];

         $this->display();

	}


}